home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / S9301.ZIP;1 / GRIVER.ZIP / LOOKARRY.PRG < prev   
Encoding:
Text File  |  1992-12-10  |  641 b   |  24 lines

  1. PROCEDURE LookArry
  2. *-- This procedure takes 3 parameters,
  3. *--  laPassed = An array
  4. *--  lcFind   = An expression to search for
  5. *--  lnCol    = The column to return
  6. *--
  7. *-- Note:  After this proc, you must test for EMPTY(value)
  8. *--        to see if it was found
  9. PARAMETER laPassed, lcFind, lnCol
  10. PRIVATE lcOldExact, lnFound, lnRow, lcRetVal
  11.  
  12. lcOldExact = SET("EXACT")                    && Saving the old value of EXACT
  13. lcRetVal = ""
  14.  
  15. lnFound = ASCAN(laPassed, lcFind)
  16. IF lnFound # 0
  17.   lnRow = ASUBSCRIPT(laPassed,lnFound,1)
  18.   lcRetVal = laPassed[lnRow,lnCol]
  19. ENDIF
  20.  
  21. SET EXACT &lcOldExact                        && We reset EXACT here
  22. RETURN lcRetVal
  23.  
  24.